<?php
session_start();
global $idMenuMain, $prefix_url, $lg, $FullUrl, $FullUrls, $tpl;
$idMenuMain = 111;
$prefix_url = "/";
// Define
define('CLASS_DIR','class/');
define('TPLS_DIR','templates/');

if (isset($_GET['lg'])) {
    $lg = mysql_real_escape_string($_GET["lg"]);
    $lg = strip_tags($lg);
    $_SESSION['lg'] = mysql_real_escape_string($_GET["lg"]);
	//echo $lg.$_GET['lg']."ngon- ngu";
} else {
    $lg = "vn";
    $_SESSION['lg'] = "vn";	
}

if(!isset($lg) or $lg == '')
{
    $lg = "vn";
    $_SESSION['lg'] = "vn";
}
include ("./debug.php");
include ('./includes/constant.php');
// Add Fuction
include('./includes/config.php');
include ("./includes/function-new.php");
include ("./includes/functions.php");


$sql = "select * from constant where name = 'FullUrl'";
$FullUrls = $db->getRow($sql);
$FullUrl = $FullUrls['value_vn'];

include (CLASS_DIR."kam.class.php");
include (CLASS_DIR.'template.php');
include (CLASS_DIR.'bao_tri.class.php');

ob_start();

	// Check $do & $act
    /* if (isset($_GET['do'])) {
        //echo 'co do'.$_GET['do'];
        $do = CleanSQLInjection(isset($_GET["do"]) ? $_GET["do"] : 'main');
        $act = CleanSQLInjection(isset($_GET["act"]) ? $_GET["act"] : "main");
		//echo $do;
       
    }else {
        //echo 'khong co do';
		$do = "main";
        $act = "main";	
    }

	// Main templates
    $file_index = "./templates/templates.php";
    if (file_exists($file_index)) {
        require ($file_index);
    } else {
        //$msg = REDIRECT_MESSAGE;
        $p = '/index.php';
    }*/
	

	if(BaoTri::Check()){
		include(TPLS_DIR.'baotri.php');
	}
	else{
		include(TPLS_DIR.'do-main.php');
	}
?>